package com.example.common.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration     //配置类
public class SpringDocConfig {
    @Bean
    public GroupedOpenApi groupedOpenApi() {
        return GroupedOpenApi.builder()
                .pathsToMatch("/**")
                .packagesToScan("com.example")
                .build();
    }

    @Bean
    public OpenAPI springDocOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("房产管理系统-项目API文档")
                        .description("本文档描述了此管理系统的微服务接口定义")
                        .version("1.0")
                        .contact(new Contact()
                                .name("张峰")
                                .url("http://www.bdqn.cn")
                                .email("zhangtianyu@qq.com")));
    }
}
